home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
utility
/
utilcli
/
random.lha
/
Random.p
< prev
Wrap
Text File
|
1996-11-14
|
882b
|
41 lines
Program Random;
{ *** Random - show a random number ***
v1.1 © JIPsoft 14th Nov 1996
Usage: Random <max>, where max is the maximum
value for the random number
This program is freely distributable }
{$I "Include:Utils/Random.i"}
{$I "Include:Utils/Parameters.i"}
{$I "Include:Utils/Stringlib.i"}
var cline: string;
seed: integer;
Function StringConvert(source: string): integer;
var c: char;
result,index: integer;
begin
result:=0;
index:=0;
c:=source[index];
while (c>='0') and (c<='9') do begin
result:=(10*result)+(ord(c)-ord('0'));
index:=index+1;
c:=source[index]
end;
StringConvert:=result
end;
begin
if 1=2 then
writeln('$VER: Random v1.1 by JIPsoft');
cline:=AllocString(255);
GetParam(1,cline);
seed:=StringConvert(cline);
SelfSeed;
writeln(RangeRandom(seed))
end.